﻿CREATE TABLE [ohrs].[DoctorHospitalPolyclinic] (
    [Id]                   INT      IDENTITY (1, 1) NOT NULL,
    [DoctorId]             INT      NOT NULL,
    [HospitalPolyclinicId] INT      NOT NULL,
    [StartDate]            DATETIME NOT NULL,
    [EndDate]              DATETIME NULL,
    CONSTRAINT [PK_DoctorHospitalPolyclinic] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_DoctorHospitalPolyclinic_Doctor] FOREIGN KEY ([DoctorId]) REFERENCES [ohrs].[Doctor] ([Id]),
    CONSTRAINT [FK_DoctorHospitalPolyclinic_HospitalPolyclinic] FOREIGN KEY ([HospitalPolyclinicId]) REFERENCES [ohrs].[HospitalPolyclinic] ([Id])
);



